﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Collections.Specialized;
using SyCODE.Component.Security;
using SyCODE.Component.DataFactory;
using SyCODE.Component;
using System.Xml;
using System.IO;
using System.Web.Security;

namespace SyCODE.Blog
{
    /// <summary>
    /// DeleteAlbumComment.aspx 的处理程序
    /// 作用：
    ///   删除像册评论
    /// </summary>
    public class DeleteAlbumComment : IHttpHandler
    {
        #region IHttpHandler 成员

        public bool IsReusable
        {
            get
            {
                return true;
            }
        }

        public void ProcessRequest(HttpContext context)
        {
            NameValueCollection nvc = new NameValueCollection(context.Request.Form);

			Ticket ticket = Ticket.Get(FormsAuthentication.FormsCookieName);

            if (Ticket.Authenticate(ticket))
            {
                nvc.Add("u", ticket.Name);

                //将评论删除任务加入任务线程
                Task.Processor.Assign(new Task.DeleteAlbumCommentTask(nvc));
            }
            else
            {
                //授权验证失败
                Function.ClientAlert(StringResource.GetField("authfaild"));
            }
        }

        #endregion
    }
}